Repository navigation
Recover faster from stalled remote streams - #156
Open
chrizzchrizz wants to merge 2 commits into
Open
chrizzchrizz wants to merge 2 commits into
chrizzchrizz wants to merge 2 commits into
Conversation
- Lower the request timeout from 60 s to 15 s so a dead connection is detected while the buffer still plays. - Reopen a stream that has not received data for 2 s when the network path changes (new cell, interface or address), instead of waiting for the timeout. - Retry when the initial range request fails without a response; previously the stream never opened.
Without range support a reopened stream starts at byte 0 again, so a retry after a network failure fed the start of the file to the parser in the middle of playback. Now the bytes the player has already read are dropped from the reopened stream. The first 4 KB of the stream are kept to check that the server delivers the same content; if it differs (e.g. a live stream), the new stream plays from its start as before. Streams with ICY metadata or a restructured MP4 keep the old behaviour. A stalled stream is now also reopened on a network path change when the server does not support ranges.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recover faster from stalled remote streams
Problem
On a weak mobile connection (short dead zones, e.g. while driving) a remote stream can hang for a long time or never recover:
bytes=0-1) fails without a response, the stream never opens.Changes
Recover faster from stalled remote streams
Resume streams without range support at the read position
Testing
RemoteAudioSourceResumeTestscover resume with and without range support and with different content.swift test: all tests pass.